package org.the.gsdo.client;

import java.util.Map;

class TokenizerUtil {

	private TokenizerUtil() {}

	public static Map<String,String> split(String token) {
		String[] tokens = token.split("&");
		Map<String,String> ret = new java.util.HashMap<String, String>();
		for (String value : tokens) {
			String[] pair = value.split("=");
			ret.put(pair[0], (pair.length == 2 ? pair[1] : null));
		}
		return ret;
	}

	public static String get(String token, String key) {
		return split(token).get(key);
	}

}